<template>
  <PageBox :data="dataInfo" @searchBtn="getTbody">
    <template #search="{ search }">
      <ElFormItemBox label="入库日期">
        <ElDaysBox :data="search" :dataName="['beginTime', 'endTime']" />
      </ElFormItemBox>
      <ElFormItemBox label="供应商" :prop="`supplierCode`">
        <ElSelectBox :data="search" dataName="supplierCode" :options="options.supplier" />
      </ElFormItemBox>
      <ElFormItemBox label="入库类型" :prop="`inStockType`">
        <ElSelectBox :data="search" dataName="inStockType" :options="options.inStockType" />
      </ElFormItemBox>
      <ElFormItemBox label="物料类型" :prop="`CategoryCode`">
        <ElSelectBox :data="search" dataName="CategoryCode" :options="options.goodType" />
      </ElFormItemBox>
      <ElFormItemBox label="物料名称" :prop="`goodsCode`">
        <ElSelectBox :data="search" dataName="goodsCode" :options="options.goods" />
      </ElFormItemBox>
      <ElFormItemBox label="物料规格" :prop="`SpecificationName`">
        <ElInputBox :data="search" dataName="SpecificationName" />
      </ElFormItemBox>
    </template>
  </PageBox>
</template>

<script setup lang="ts">
// const { proxy } = getCurrentInstance() as any;
import './pageCss.scss'; // 引入样式
import { useListComponent } from './pageTs'; // 引入逻辑
const { dataInfo, getTbody } = useListComponent();
import { getSupplier, getInStockType, getGoods, getGoodType } from '@/utils/optionsArr.ts';
const options = reactive({
  supplier: [],
  inStockType: [],
  goodType: [],
  goods: [],
})
onMounted(() => {
  getSupplier(options, 'supplier') //获取供应商
  getInStockType(options, 'inStockType') //获取入库类型
  getGoods(options, 'goods') //获取所有物料
  getGoodType(options, 'goodType') //获取物料类型
});
</script>
